#include "stack.h"

int main(void)
{
  /* 初始化*/
  Stack *s = init_stack();
  print_stack(s);

  /* 入栈 */
  push(s, 1);
  push(s, 3);
  push(s, 2);
  print_stack(s);
  push(s, 5);
  push(s, 4);
  print_stack(s);

  /* 访问栈顶元素的值 */
  printf("\n%d\n", peek(s));
  printf("length: %d\n", get_length(s));

  /* 出栈 */
  int a = pop(s);
  printf("\nRemoved %d\n", a);
  printf("length: %d\n", get_length(s));
  print_stack(s);
  
  /* 销毁 */
  destory_stack(s);
  
  return 0;
}
